package services.login;

import java.util.HashMap;
import javax.sql.*;
import com.PublicSystem;
/**
 * PersonMgrFacade:登录组件
 * @author fcl
 * @version july 14, 2016
 * @since 1.0
 */
public class LoginServices {
	PublicSystem sys = PublicSystem.getInstance();
	/**
	 * 获取登录验证信息
	 * @param map
	 * @return
	 * @throws Exception
	 */
	public String getUser(HashMap map) throws Exception {
		String res = "登录成功！";
		res = sys.SelResultStr("select id from oa_usertable where id='" + map.get("username") + "' and userpassword='" + map.get("userpwd") + "'");
		String reslut =  res != null ? res : "1";
		return reslut; 
	}
	/**
	 * 获取登录url
	 * @param sid
	 * @return
	 * @throws Exception
	 */
	public String getUrl(String sid) throws Exception {
		String sql = "SELECT url FROM oa_tymenu WHERE id='" + sid + "'";
		return sys.SelResultStr(sql);
	}
}